from redis import StrictRedis

class Config:
    DEBUG = None

    # 设置密钥
    SECRET_KEY = 'cYaRoiV/yG7qq6L2/nPHKOgqGspSjkBDJ02iWrhQFJaz8002cI3GbjsZnP5tEV3vad8='

    SESSION_TYPE = 'redis'  # 配置状态保持中的session信息，存储在redis数据库中
    SESSION_REDIS = StrictRedis(host='127.0.0.1', port=6379)  # session连接的redis数据库实例
    SESSION_USE_SIGNER = True  # session签名
    PERMANENT_SESSION_LIFETIME = 3600 * 2  # session有效期

    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@localhost/ljj_flask_news'
    # 动态追踪修改
    SQLALCHEMY_TRACK_MODIFICATIONS = False

class DevelopmentConfig(Config):
    DEBUG = True

class ProductionConfig(Config):
    DEBUG = False

config_dic = {
    "development": DevelopmentConfig,
    "production": ProductionConfig
}